﻿var GetTitle = function (elCell, oRecord, oColumn, sData) {
    var ID = oRecord.getData("ID");
    var title = oRecord.getData("title");
    var UserID = oRecord.getData("AddUser");
    elCell.innerHTML = "<a href='javascript:transForForm(\"" + title + "\",\"/EHR/MsgReplyPage.aspx?r=" + Math.random() + "&id=" + ID + "&UserID=" + UserID + "\");'>" + title + "</a><br />";
//    elCell.innerHTML = "<a href='javascript:transForForm(\"" + title + "\",\"/Extend/MsgreplyModify.aspx?r=" + Math.random() + "&entity=V_MsgFKList&id=" + ID + "&PageState=View\");'>" + title + "</a><br />";

}

var transForForm = function (title, url) {
    parent.addTabs(title, url);
}
parent.NeedRefreshPage = this;

function reply_Function() {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    //var a = record.getData(const_entityID)

    if (record == null) {
        alert("请选择一条记录");
        return;
    }

    var UserID = record.getData("AddUser");
    var ID = record.getData("ID");

    //显示弹出窗口
    //    document.getElementById("EditUIWindow").src = "../EHR/MsgReplyPage.aspx?ID=" + ID + "&UserID=" + UserID;
    //    document.getElementById("yui-gen7-button").style.display = "none";
    //    YAHOO.example.container.dialog1.setHeader("回复信息");
    //    YAHOO.example.container.dialog1.show();

    //显示新选项卡
    var pagetitle = "回复信息";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../EHR/MsgReplyPage.aspx?r=" + Math.random() + "&id=" + ID + "&UserID=" + UserID + ""));
    parent.NeedRefreshPage = this;

}

//获取url里的参数值 name:参数名称
function getPar(source, name) {
    var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");
    if (reg.test(source))
        return RegExp.$2;
    return "";
};

//双击事件
function CustomDbClick() {
    if (typeof (fnCustomEdit) == "function") {
        reply_Function();
    }
}



//初始化内置页面时
window.onload = function () {
    //document.getElementById("btnAddNew-button").innerHTML = "提交建议";
    //window.parent.$("#tabs").tabs('close', '提交月度建议');
}